import unittest

class Demo1TestCase(unittest.TestCase):
    def tses1(self):
        print('test1')

    def test2(self):
        print('test2')

class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print('testa')

    def testb(self):
        print('test2')


if __name__ == '__main__':
    # 普通执行方法
    # unittest.main(verbosity=2)

    # TODO suite 测试套件
    # TODO addtest
    # addtest加载方法的顺序，就是执行的顺序
    suite = unittest.TestSuite()
    suite.addTest(Demo1TestCase('test2'))
    suite.addTest(Demo2TestCase('testa'))

    # runner执行器
    # 创建执行器对象
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)